import request from '@/utils/request';

export const getOnlineMediaServerList = () => {
    return request({
        url: `/api/server/media_server/online/list`,
        method: 'get'
    })
}
export const getMediaServerList = () => {
    return request({
        url: `/api/server/media_server/list`,
        method: 'get'
    })
}
export const getMediaServer = (id: any) => {
    return request({
        url: `/api/server/media_server/one/` + id,
        method: 'get'
    })
}
export const checkServer = (param: any) => {
    return request({
        url: `/api/server/media_server/check`,
        method: 'get',
        params: {
            ip: param.ip,
            port: param.httpPort,
            secret: param.secret,
            type: param.type
        }
    })
}
export const checkRecordServer = (param: any) => {
    return request({
        url: `/api/server/media_server/record/check`,
        method: 'get',
        params: {
            ip: param.ip,
            port: param.recordAssistPort
        }
    })
}
export const addServer = (data: any) => {
    return request({
        url: `/api/server/media_server/save`,
        method: 'post',
        data: data
    })
}
export const deleteServer = (id: any) => {
    return request({
        url: `/api/server/media_server/delete`,
        method: 'delete',
        params: {
            id: id
        }
    })
}
